Search content/people/topic#14
Open
MaxPoon wants to merge 17 commits intolzjun567:masterfrom
MaxPoon:search
Open
Search content/people/topic#14MaxPoon wants to merge 17 commits intolzjun567:masterfrom MaxPoon:search
MaxPoon wants to merge 17 commits intolzjun567:masterfrom
MaxPoon:search
Conversation
Fity
reviewed
May 3, 2017
|
|
||
| class Search(Model): | ||
| @need_login | ||
| def search_content(self, q=''): |
There was a problem hiding this comment.
search_content作为一个方法名太含糊了- 参数名最好明确一点,不要叫
q,没必要和知乎请求参数保持一致 - 没考虑分页,万一我传了个很简单的关键字,查出来一万条,你也直接返回么?或者,你知道那种情况下需要多长时间这个方法才能执行完么?
- 小伙子加油!整体还不错~
Contributor
Author
There was a problem hiding this comment.
谢谢你的建议!
- 有什么好建议吗?search question?
- 其实发送一次request它是固定返回10条搜索结果的,所以不存在结果太多的问题。如果是需要更多结果可以继续发request,params中加个offset即可,每个request都是返回10条结果。现在问题在于这十条之中有可能存在专栏。在考虑怎样写比较优雅。
Contributor
Author
|
当初设想要实现的功能都实现了,帮忙看看能不能merge吧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
先发上来看看有什么建议
Todo: